package depth_first_search;

/**
 * author :  apurv verma
 * email  :  dapurv5@gmail.com
 */

/*
 * UTILITY: Can find the shortest path from the source cell to the goal cell in a 2d and 3d maze.
 */

public class MAIN {
	
	
	//USAGE
	
	public static void main(String args[]){
		
		//1: CREATE AN INSTANCE OF Maze3D class.
	
		Maze3D m3d=new Maze3D(4,new Dimension(0,0,0),new Dimension(3,3,3),"maze3dSize=3.txt");
	
		/* Here 4 is the size of the maze.
		 * (0,0,0) is the starting cell
		 * (3,3,3) is the goal cell.
		 * "maze3dSize=3.txt" has the following format
		 * 	1 1 1
		 *  1 2 3
		 *  The cell locations (1,1,1) and (1,2,3) will serve as OBSTACLES.
		 */
	
		//2:NOW CREATE AN INSTANCE OF DepthFirstSearch3D class AND PASS THE MAZE AS THE PARAMETER.
		
		DepthFirstSearch3D dfs3d=new DepthFirstSearch3D(m3d);
		
		//3:INVOKE THE FUNCTION doSearchOn3DMaze()
		dfs3d.doSearchOn3DMaze();
	
		//4.THE PATH WILL BE STORED AS AN ARRAY OF DIMENSION IN THE INSTANCE VARIABLE.
		//dfs3d.shortestPath[]
		
		for(int i=0;i<dfs3d.shortestPath.length;i++){
			System.out.println(dfs3d.shortestPath[i].getX()+","+dfs3d.shortestPath[i].getY()+","+dfs3d.shortestPath[i].getZ());
		}
		
	}
}
